﻿using System;
using System.Collections.Generic;

namespace IBNet.DayTrade
{
   /// <summary>
   /// A container of values for constructing a bracket target order, 
   /// a bracket trailing order, and a bracket time stop order.
   /// </summary>
   public struct BracketOrderConstantsBag
   {
      private readonly decimal _targetAmount;
      private readonly decimal _trailingAmount;
      private readonly DateTime _goodAfterTime;

      /// <summary>
      /// Creates a new BracketOrderConstantsBag that contains a target amount, 
      /// trailing amount, and good till date for use in constructing bracket orders.
      /// </summary>
      /// <param name="targetAmount">The target amount for the bracket target order. 
      /// For example if trading YM, 20 (points) could be a targetAmount. 
      /// If trading USD.EUR, 50 (pips) could be a targetAmount.</param>
      /// <param name="trailingAmount">The trailing amount for the bracket trailing order.</param>
      /// <param name="goodTillDate">The good till date for all three 
      /// (target order, trailing order, time stop order) bracket orders.
      /// goodTillDate must be in format "yyyyMMdd HH:mm:ss".</param>
      public BracketOrderConstantsBag(decimal targetAmount, decimal trailingAmount, 
         DateTime goodTillDate)
      {
         this._targetAmount = targetAmount;
         this._trailingAmount = trailingAmount;
         this._goodAfterTime = goodTillDate;
      }

      /// <summary>
      /// Gets the target amount for the bracket target order.
      /// </summary>
      public decimal TargetAmount { get { return _targetAmount; } }

      /// <summary>
      /// Gets the trailing amount for the bracket trailing order.
      /// </summary>
      public decimal TrailingAmount { get { return _trailingAmount; } }

      /// <summary>
      /// Gets the good after date for the three bracket orders.
      /// </summary>
      public DateTime GoodAfterTime { get { return _goodAfterTime; } }
   }
}
